# -*- coding:utf-8 -*-
'''
Created on 2012-7-16

@author: duoyi
'''


class Response(object):

    def __init__(self, url, status=200, headers=None, body='', flags=None, request=None):
        self.headers = headers
        self.status = int(status)
        self.body=body
        self.url=url
        self.request = request
        self.flags = flags

    def meta(self):
        try:
            return self.request.meta
        except AttributeError:
            raise AttributeError("Response.meta not available, this response " \
                "is not tied to any request")














